const fs = require("fs")

function fn( path ){
    return (req,res,next)=>{
        fs.readFile(path + req.url, "utf-8", (err, data)=>{
            if(err){
                res.write("404")
            }else{
                res.write(data);
            }
            res.end();
        })
    }
}

module.exports = fn;